gtk4.git
4 years agocssimageurl: Remove direct pixbuf use
Matthias Clasen [Fri, 16 Apr 2021 22:05:21 +0000 (18:05 -0400)]
cssimageurl: Remove direct pixbuf use

Rely on the gdkpixbufutils api that gives us
a paintable.

4 years agoimage, picture: Move pixbuf code to gdkpixbufutils
Matthias Clasen [Fri, 16 Apr 2021 21:17:26 +0000 (17:17 -0400)]
image, picture: Move pixbuf code to gdkpixbufutils

This cleans up and moves the code to load files
while taking the scale into account. Along the way,
we drop the last uses of GdkPixbufAnimation, and
consolidate the pixbuf using code in one place.

4 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Fri, 16 Apr 2021 15:16:48 +0000 (15:16 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

pixbufutils: Remove an unused function

See merge request GNOME/gtk!3447

4 years agoMerge branch 'wayland-xdg-surface-setup' into 'master'
Matthias Clasen [Fri, 16 Apr 2021 15:16:28 +0000 (15:16 +0000)]
Merge branch 'wayland-xdg-surface-setup' into 'master'

wayland: Don't duplicate xdg_surface setup code

See merge request GNOME/gtk!3191

4 years agoMerge branch 'wayland-parent-shadow-refactor' into 'master'
Jonas Ådahl [Fri, 16 Apr 2021 14:34:42 +0000 (14:34 +0000)]
Merge branch 'wayland-parent-shadow-refactor' into 'master'

wayland: Avoid directly accessing shadow property of parent surface

See merge request GNOME/gtk!3190

4 years agowayland: Don't duplicate xdg_surface setup code
David Keijser [Wed, 3 Feb 2021 21:09:11 +0000 (22:09 +0100)]
wayland: Don't duplicate xdg_surface setup code

4 years agowayland: Avoid directly accessing shadow property of parent surface
David Keijser [Sat, 30 Jan 2021 17:21:56 +0000 (18:21 +0100)]
wayland: Avoid directly accessing shadow property of parent surface

4 years agopixbufutils: Remove an unused function
Matthias Clasen [Fri, 16 Apr 2021 10:52:43 +0000 (06:52 -0400)]
pixbufutils: Remove an unused function

4 years agoMerge branch 'latest.glib.msvc' into 'master'
Matthias Clasen [Fri, 16 Apr 2021 12:25:43 +0000 (12:25 +0000)]
Merge branch 'latest.glib.msvc' into 'master'

Fix builds against latest stable GLib with MSVC

See merge request GNOME/gtk!3443

4 years agoMerge branch 'fix-focus-unsetting' into 'master'
Matthias Clasen [Fri, 16 Apr 2021 11:47:44 +0000 (11:47 +0000)]
Merge branch 'fix-focus-unsetting' into 'master'

window: Fix deferred focus unsetting

Closes #3413

See merge request GNOME/gtk!3446

4 years agowindow: Fix deferred focus unsetting
Matthias Clasen [Fri, 16 Apr 2021 11:26:32 +0000 (07:26 -0400)]
window: Fix deferred focus unsetting

In commit 4a76abffd4d62cbb, we deferred unsetting focus
and default until after the next draw, overlooking the
case where the focus is set to another widget before we
ever get to the unsetting.

Fixes: #3413
4 years agoGTK: Fix builds against latest stable GLib with MSVC
Chun-wei Fan [Fri, 16 Apr 2021 03:36:18 +0000 (11:36 +0800)]
GTK: Fix builds against latest stable GLib with MSVC

GLib-2.68.x now considers warning C4098 ('void' function returning a value) as
an error, so avoid doing that.

4 years agoGSK: Fix builds against latest stable GLib with MSVC
Chun-wei Fan [Fri, 16 Apr 2021 03:33:00 +0000 (11:33 +0800)]
GSK: Fix builds against latest stable GLib with MSVC

GLib-2.68.x now considers warning C4098 ('void' function returning a value) as
an error, so avoid doing that.

4 years agoGDK: Fix builds against latest stable GLib with MSVC
Chun-wei Fan [Fri, 16 Apr 2021 03:22:27 +0000 (11:22 +0800)]
GDK: Fix builds against latest stable GLib with MSVC

GLib-2.68.x now considers warning C4098 ('void' function returning a value) as
an error, so avoid doing that.

4 years agoMerge branch 'im-context-event-leak' into 'master'
Matthias Clasen [Thu, 15 Apr 2021 22:16:49 +0000 (22:16 +0000)]
Merge branch 'im-context-event-leak' into 'master'

imcontext: Eat key events during preedit

See merge request GNOME/gtk!3440

4 years agoMerge branch 'theme-fallback-fix' into 'master'
Matthias Clasen [Thu, 15 Apr 2021 21:31:09 +0000 (21:31 +0000)]
Merge branch 'theme-fallback-fix' into 'master'

themes: Make fallback work a bit better

See merge request GNOME/gtk!3441

4 years agothemes: Make fallback work a bit better
Matthias Clasen [Thu, 15 Apr 2021 21:08:15 +0000 (17:08 -0400)]
themes: Make fallback work a bit better

One case we did not include in fd329e0ec582d7562f444b is

Adwaita-dark -> Default:dark

It turns out that it is needed.

4 years agoimcontext: Eat key events during preedit
Matthias Clasen [Thu, 15 Apr 2021 20:59:02 +0000 (16:59 -0400)]
imcontext: Eat key events during preedit

Avoid passing through random key press or release
events while we are showing preedit. That prevents
'accidents' like typing Ctrl-. bringing up the
Emoji chooser during preedit, or hitting Ctrl-a
after the Compose key moving the 'dot' around in
vim in terminals.

4 years agoMerge branch 'demo-manpages' into 'master'
Matthias Clasen [Thu, 15 Apr 2021 11:15:24 +0000 (11:15 +0000)]
Merge branch 'demo-manpages' into 'master'

meson: only build demo manpages when demos are enabled

See merge request GNOME/gtk!3438

4 years agoMerge branch 'theme-icon-filter-fixes' into 'master'
Matthias Clasen [Thu, 15 Apr 2021 11:12:28 +0000 (11:12 +0000)]
Merge branch 'theme-icon-filter-fixes' into 'master'

theme: Use -gtk-icon-filter for full-color icons

See merge request GNOME/gtk!1990

4 years agotheme: Use -gtk-icon-filter for full-color icons
nana-4 [Sat, 30 May 2020 21:37:06 +0000 (06:37 +0900)]
theme: Use -gtk-icon-filter for full-color icons

Not for symbolic icons.

Don't apply `-gtk-icon-filter: opacity(0.5);` to the symbolic icons as
they already have the "gray" colors indicating the disabled state.
Symbolic icons can be styled using the `color` property.

Also remove the obsolete comment.

4 years agomeson: only build demo manpages when demos are enabled
Eli Schwartz [Wed, 14 Apr 2021 02:48:39 +0000 (22:48 -0400)]
meson: only build demo manpages when demos are enabled

Installing them even when manpages are enabled, but the demos are
disabled, produces manpages for unavailable programs...

4 years agoMerge branch 'x11-quiet-exit' into 'master'
Matthias Clasen [Wed, 14 Apr 2021 00:32:05 +0000 (00:32 +0000)]
Merge branch 'x11-quiet-exit' into 'master'

x11: Be quiet on exit by default

See merge request GNOME/gtk!3436

4 years agoMerge branch 'ngl-crash' into 'master'
Matthias Clasen [Tue, 13 Apr 2021 22:02:44 +0000 (22:02 +0000)]
Merge branch 'ngl-crash' into 'master'

ngl: Fix a rare assertion violation

Closes #3853

See merge request GNOME/gtk!3434

4 years agox11: Be quiet on exit by default
Matthias Clasen [Tue, 13 Apr 2021 18:52:09 +0000 (14:52 -0400)]
x11: Be quiet on exit by default

The condition we check for to catch X servers going away
may not be accurate anymore, and the warning shows up in
logs, causing customers to be concerned. So, be quiet by
default, unless the user explicitly asked for a message.

4 years agoMerge branch 'flatpak-highlight' into 'master'
Matthias Clasen [Tue, 13 Apr 2021 11:38:45 +0000 (11:38 +0000)]
Merge branch 'flatpak-highlight' into 'master'

flatpak: Include highlight in gtk4-demo flatpak

Closes #3867

See merge request GNOME/gtk!3433

4 years agoflatpak: Include highlight in gtk4-demo flatpak
Matthias Clasen [Tue, 13 Apr 2021 03:53:52 +0000 (23:53 -0400)]
flatpak: Include highlight in gtk4-demo flatpak

Include the highlight utility to make syntax
highlighting work in gtk4-demo. This requires
building its dependencies as well, boost and lua.

4 years agongl: Fix a rare assertion violation
Matthias Clasen [Tue, 13 Apr 2021 02:51:01 +0000 (22:51 -0400)]
ngl: Fix a rare assertion violation

When we clean up the uniform allocations after a frame,
it can happen that our space requirements actually increase,
due to padding that depends on the order of allocations.

Instead of asserting that it doesn't happen, just make
it work by growing our allocation.

Fixes: #3853
4 years agoMerge branch 'testsuite-asserts' into 'master'
Matthias Clasen [Tue, 13 Apr 2021 02:46:07 +0000 (02:46 +0000)]
Merge branch 'testsuite-asserts' into 'master'

testsuite: Reduce the use of g_assert

Closes #3864

See merge request GNOME/gtk!3432

4 years agobuild: Quiet the compiler
Matthias Clasen [Tue, 13 Apr 2021 02:11:05 +0000 (22:11 -0400)]
build: Quiet the compiler

Don't use -Wnull-dereference when assertions are
disabled, since that causes the compiler to see
NULL everywhere.

4 years agowayland: Build with G_DISABLE_ASSERT
Emmanuele Bassi [Mon, 12 Apr 2021 10:59:56 +0000 (11:59 +0100)]
wayland: Build with G_DISABLE_ASSERT

4 years agobuild: Don't append multiple flags as a string
Emmanuele Bassi [Mon, 12 Apr 2021 10:29:24 +0000 (11:29 +0100)]
build: Don't append multiple flags as a string

The gtk_debug_cflags variable is an array, with each argument stored in
a separate string; if we add multiple arguments inside the same string
we break the escaping rules.

Fixes: #3864
4 years agogsk/ngl: Build with G_DISABLE_ASSERT enabled
Emmanuele Bassi [Mon, 12 Apr 2021 11:27:55 +0000 (12:27 +0100)]
gsk/ngl: Build with G_DISABLE_ASSERT enabled

4 years agoForce g_test_init to cooperate
Matthias Clasen [Tue, 13 Apr 2021 01:22:04 +0000 (21:22 -0400)]
Force g_test_init to cooperate

Change all g_test_init calls in the testsuite
to avoid the macro, so they work regardless of
G_DISABLE_ASSERT.

4 years agoMake gtk_test_init work without assertions
Matthias Clasen [Tue, 13 Apr 2021 00:57:02 +0000 (20:57 -0400)]
Make gtk_test_init work without assertions

The g_test_init macro 'helpfully' refuses to work when
assertions are disabled. So we just use the function.

4 years agoRemove assertions in tests
Matthias Clasen [Tue, 13 Apr 2021 00:56:46 +0000 (20:56 -0400)]
Remove assertions in tests

4 years agoInspector: Fix a possible undefined use
Matthias Clasen [Tue, 13 Apr 2021 00:56:19 +0000 (20:56 -0400)]
Inspector: Fix a possible undefined use

4 years agoFix unused variable warnings
Matthias Clasen [Tue, 13 Apr 2021 00:55:01 +0000 (20:55 -0400)]
Fix unused variable warnings

These happen for variables which are only used
in assertions, when assertions are disabled.

4 years agogtk-demo: Avoid compiler warnings without assertions
Matthias Clasen [Mon, 12 Apr 2021 21:12:01 +0000 (17:12 -0400)]
gtk-demo: Avoid compiler warnings without assertions

Avoid an unused variable warning.

4 years agogsk: Avoid compiler warnings without assertions
Matthias Clasen [Mon, 12 Apr 2021 21:08:33 +0000 (17:08 -0400)]
gsk: Avoid compiler warnings without assertions

Disabling assertions was provoking some unused variable
warnings from the compiler. Avoid these.

4 years agotestsuite: Reduce the use of g_assert
Matthias Clasen [Mon, 12 Apr 2021 20:12:25 +0000 (16:12 -0400)]
testsuite: Reduce the use of g_assert

Stop using g_assert() in the gtk tests.

4 years agotestsuite: Reduce the use of g_assert
Matthias Clasen [Mon, 12 Apr 2021 19:30:29 +0000 (15:30 -0400)]
testsuite: Reduce the use of g_assert

Stop using g_assert() in the gsk tests.

4 years agoMerge branch 'f16c.msvc' into 'master'
Matthias Clasen [Mon, 12 Apr 2021 20:35:10 +0000 (20:35 +0000)]
Merge branch 'f16c.msvc' into 'master'

Fix F16C build/runtime detection on Visual Studio

See merge request GNOME/gtk!3429

4 years agoMerge branch 'testsuite-asserts' into 'master'
Matthias Clasen [Mon, 12 Apr 2021 12:47:09 +0000 (12:47 +0000)]
Merge branch 'testsuite-asserts' into 'master'

testsuite: Reduce use of g_assert

See merge request GNOME/gtk!3431

4 years agotestsuite: Reduce use of g_assert
Matthias Clasen [Mon, 12 Apr 2021 12:33:41 +0000 (08:33 -0400)]
testsuite: Reduce use of g_assert

Stop using g_assert() in the css tests.

4 years agotestsuite: Reduce use of g_assert
Matthias Clasen [Mon, 12 Apr 2021 12:30:56 +0000 (08:30 -0400)]
testsuite: Reduce use of g_assert

Stop using g_assert() in the reftests.

4 years agotestsuite: Reduce use of g_assert
Matthias Clasen [Mon, 12 Apr 2021 12:16:45 +0000 (08:16 -0400)]
testsuite: Reduce use of g_assert

Stop using g_assert() in the gdk tests.

4 years agomeson.build: Check for F16C on 32-bit Visual Studio
Chun-wei Fan [Mon, 12 Apr 2021 09:58:46 +0000 (17:58 +0800)]
meson.build: Check for F16C on 32-bit Visual Studio

It is also possible to enable F16C instructions on 32-bit Visual Studio builds,
so also check for the compiler's ability to build F16C code on Visual Studio
32-bit instead of just bailing out.

4 years agogsk/ngl/fp16.c: Implement runtime F16C detection on MSVC
Chun-wei Fan [Mon, 12 Apr 2021 08:48:15 +0000 (16:48 +0800)]
gsk/ngl/fp16.c: Implement runtime F16C detection on MSVC

We need to use __cpuid() to check for the presence of F16C instructions on
Visual Studio builds, and call the half_to_float4() or float_to_half4()
implementation accordingly, as the __builtin_cpu...() functions are strictly
for GCC or CLang only.

Also, since __m128i_u is not a standard intrisics type across the board, just
use __m128i on Visual Studio as it is safe to do so there for use for
_mm_loadl_epi64().

Like running on Darwin, we cannot use the alias __attribute__ as __attribute__
is also for GCC and CLang only.

4 years agomeson.build: Improve F16C detection on Visual Studio
Chun-wei Fan [Mon, 12 Apr 2021 08:24:37 +0000 (16:24 +0800)]
meson.build: Improve F16C detection on Visual Studio

The __builtin_cpu...() intrisics are strictly for GCC/CLang-based compilers, so
don't use them in the checking code on Visual Studio.  The test code will still
compile without this change, but will certainly fail if we want it to link.

4 years agoMerge branch 'ngl-shadow-fixes' into 'master'
Matthias Clasen [Mon, 12 Apr 2021 05:07:29 +0000 (05:07 +0000)]
Merge branch 'ngl-shadow-fixes' into 'master'

ngl: Fix outset blurred shadows

See merge request GNOME/gtk!3427

4 years agoMerge branch 'grouped-toggle-fix' into 'master'
Matthias Clasen [Mon, 12 Apr 2021 02:40:43 +0000 (02:40 +0000)]
Merge branch 'grouped-toggle-fix' into 'master'

togglebutton: Fix expected group behavior

See merge request GNOME/gtk!3425

4 years agoMerge branch 'shadow-reduction' into 'master'
Matthias Clasen [Mon, 12 Apr 2021 02:39:55 +0000 (02:39 +0000)]
Merge branch 'shadow-reduction' into 'master'

gsk: Don't overshadow

See merge request GNOME/gtk!3419

4 years agongl: Fix unevenly scaled shadows
Matthias Clasen [Mon, 12 Apr 2021 02:26:36 +0000 (22:26 -0400)]
ngl: Fix unevenly scaled shadows

Ensure that we don't cut them off at the edges.

4 years agongl: Don't slice unsliceable shadows
Matthias Clasen [Mon, 12 Apr 2021 02:09:45 +0000 (22:09 -0400)]
ngl: Don't slice unsliceable shadows

When the corners are too big to make slicing work,
don't do it, since it leads to broken results.

4 years agongl: Fix a case of flipped shadow
Matthias Clasen [Mon, 12 Apr 2021 02:02:44 +0000 (22:02 -0400)]
ngl: Fix a case of flipped shadow

In the non-sliced case, we were rendering the shadow
upside down.

4 years agongl: Add code to dump shadows
Matthias Clasen [Mon, 12 Apr 2021 01:13:47 +0000 (21:13 -0400)]
ngl: Add code to dump shadows

This can be helpful in understanding shadow bugs.

4 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Sun, 11 Apr 2021 22:41:26 +0000 (22:41 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

menubutton: Propagate focus-on-click

See merge request GNOME/gtk!3424

4 years agotogglebutton: Fix expected group behavior
Matthias Clasen [Sun, 11 Apr 2021 22:29:53 +0000 (18:29 -0400)]
togglebutton: Fix expected group behavior

The expectation is that a grouped button stays
active when you click it. Grouped check buttons
behave this way, and grouped toggle buttons should
too.

4 years agonode-editor: Make header buttons not steal focus
Matthias Clasen [Sun, 11 Apr 2021 19:31:31 +0000 (15:31 -0400)]
node-editor: Make header buttons not steal focus

This is rarely useful, and is confusing when it
happens as side-effect of dragging the window.

4 years agoicon browser: Make header buttons not steal focus
Matthias Clasen [Sun, 11 Apr 2021 19:27:52 +0000 (15:27 -0400)]
icon browser: Make header buttons not steal focus

This is rarely useful, and is confusing when it
happens as side-effect of dragging the window.

4 years agowidget-factory: Make header buttons not steal focus
Matthias Clasen [Sun, 11 Apr 2021 19:24:10 +0000 (15:24 -0400)]
widget-factory: Make header buttons not steal focus

This is rarely useful, and is confusing when it
happens as side-effect of dragging the window.

4 years agogtk-demo: Make header buttons not steal focus
Matthias Clasen [Sun, 11 Apr 2021 19:23:24 +0000 (15:23 -0400)]
gtk-demo: Make header buttons not steal focus

This is rarely useful, and is confusing when it
happens as side-effect of dragging the window.

4 years agomenubutton: Propagate focus-on-click
Matthias Clasen [Sun, 11 Apr 2021 19:22:00 +0000 (15:22 -0400)]
menubutton: Propagate focus-on-click

Propagate the focus-on-click setting to the button
inside, so that setting menubuttons as !focus-on-click
works as expected. This helps for menubuttons in
header bars, where dragging on the button will otherwise
steal focus from the content.

4 years agoUpdate Ukrainian translation
Yuri Chornoivan [Sun, 11 Apr 2021 18:39:40 +0000 (18:39 +0000)]
Update Ukrainian translation

4 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Sun, 11 Apr 2021 18:23:54 +0000 (18:23 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

some small optimizations

See merge request GNOME/gtk!3423

4 years agongl: Allow passing bounds to update_clip
Matthias Clasen [Sun, 11 Apr 2021 15:57:22 +0000 (11:57 -0400)]
ngl: Allow passing bounds to update_clip

update_clip only uses the bounds of the node that
we are currently passing. This opens the door to
updating the clip while handling a single node.

4 years agongl: Small optimization for shadows
Matthias Clasen [Sat, 10 Apr 2021 15:23:06 +0000 (11:23 -0400)]
ngl: Small optimization for shadows

When 9-slicing shadows, omit the center tile when it is
entirely contained in the outline (that is not always
the case, depending on corners and offsets).

4 years agoroundedrect: Speed up contains_rect and friends
Matthias Clasen [Sun, 11 Apr 2021 00:52:50 +0000 (20:52 -0400)]
roundedrect: Speed up contains_rect and friends

gsk_rounded_rect_contains_rect was calling
gsk_rounded_rect_contains_point, which potentially
checks all four corners, for a total of up to 16
corner/point checks. But there is no need to do
more than 4 such checks to answer the question.

4 years agongl: Small optimization
Matthias Clasen [Sun, 11 Apr 2021 00:26:45 +0000 (20:26 -0400)]
ngl: Small optimization

We really want equality here.

4 years agonodeeditor: Make the help window wide enough
Matthias Clasen [Sat, 10 Apr 2021 15:42:58 +0000 (11:42 -0400)]
nodeeditor: Make the help window wide enough

Make the help window wide enough to show the
tables without wrapping.

4 years agoMerge branch 'media-memory-leak' into 'master'
Matthias Clasen [Sat, 10 Apr 2021 13:42:41 +0000 (13:42 +0000)]
Merge branch 'media-memory-leak' into 'master'

media: Fix a memory leak

See merge request GNOME/gtk!3420

4 years agomedia: Fix a memory leak
Matthias Clasen [Sat, 10 Apr 2021 13:01:09 +0000 (09:01 -0400)]
media: Fix a memory leak

This was introduced in e7dc82fa32f9c115607.

4 years agogsk: Don't overshadow
Matthias Clasen [Thu, 8 Apr 2021 13:36:51 +0000 (09:36 -0400)]
gsk: Don't overshadow

Reduce the cairo shadows to the same size as their GL brethren.

4 years agoMerge branch 'popover-list-lockup' into 'master'
Matthias Clasen [Sat, 10 Apr 2021 00:34:24 +0000 (00:34 +0000)]
Merge branch 'popover-list-lockup' into 'master'

window: Defer focus setting until after paint

Closes #3725

See merge request GNOME/gtk!3417

4 years agowindow: Defer focus setting until after paint
Matthias Clasen [Fri, 9 Apr 2021 23:38:25 +0000 (19:38 -0400)]
window: Defer focus setting until after paint

Commit 3dbf5038fab8eb0d8c11 tried to defer focus changes
until after rendering is done. But it failed to do so, since
the toplevel ::render handler is still before rendering of
popups that are attached to that toplevel. To do this
properly, we need to do it in the AFTER_PAINT frame clock
phase.

Fixes: #3725
4 years agoMerge branch 'ngl-coloring-underlines' into 'master'
Matthias Clasen [Fri, 9 Apr 2021 15:36:21 +0000 (15:36 +0000)]
Merge branch 'ngl-coloring-underlines' into 'master'

Optimize underlines in text

See merge request GNOME/gtk!3414

4 years agoMerge branch 'no-scroll-cursor' into 'master'
Matthias Clasen [Fri, 9 Apr 2021 13:30:36 +0000 (13:30 +0000)]
Merge branch 'no-scroll-cursor' into 'master'

scrolledwindow: Stop using scroll cursors

See merge request GNOME/gtk!3416

4 years agoMerge branch 'ebassi/ci-docs' into 'master'
Matthias Clasen [Fri, 9 Apr 2021 12:35:49 +0000 (12:35 +0000)]
Merge branch 'ebassi/ci-docs' into 'master'

ci: Drop the split Fedora images

See merge request GNOME/gtk!3415

4 years agoscrolledwindow: Stop using scroll cursors
Matthias Clasen [Fri, 9 Apr 2021 12:26:09 +0000 (08:26 -0400)]
scrolledwindow: Stop using scroll cursors

We used to override cursor to use all-scroll while the
content is being scrolled. Unfortunately, there is several
problems with this:
- It is really only expected certain devices, and we don't
  have the device information on Wayland
- With the way cursor setting works in GTK4, non-NULL cursors
  of the content (eg the text views ibeam) win, making the
  scroll cursor not show up
- Under X11, we seem to miss scroll end events and then
  the scroll cursor gets stuck
Therefore, just remove this feature.

4 years agoci: Drop the split Fedora images
Emmanuele Bassi [Fri, 9 Apr 2021 11:28:08 +0000 (12:28 +0100)]
ci: Drop the split Fedora images

Now that we don't need the whole of Pandoc to build our documentation,
we can go back to a single Fedora image for our CI.

4 years agongl: Add a program change counter
Matthias Clasen [Fri, 9 Apr 2021 04:52:18 +0000 (00:52 -0400)]
ngl: Add a program change counter

Count how often we change programs during a frame.

4 years agongl: Optimize underlines in text
Matthias Clasen [Fri, 9 Apr 2021 03:11:06 +0000 (23:11 -0400)]
ngl: Optimize underlines in text

Opportunistically use the coloring program for
drawing underlines instead of the color program.
This avoids program changes in the middle of
text.

For the Emoji text scrolling benchmark, this reduces
the program changes per frame from > 1000 to around 100.

4 years agongl: Reserve a pixel in texture atlases
Matthias Clasen [Fri, 9 Apr 2021 02:28:40 +0000 (22:28 -0400)]
ngl: Reserve a pixel in texture atlases

This will be used for coloring from the texture.

4 years agongl: Fix an oversight
Matthias Clasen [Fri, 9 Apr 2021 03:10:10 +0000 (23:10 -0400)]
ngl: Fix an oversight

All the rest of debug spew goes to stderr here.

4 years agogtk-demo: Make one text scroll benchmark harder
Matthias Clasen [Fri, 9 Apr 2021 03:09:14 +0000 (23:09 -0400)]
gtk-demo: Make one text scroll benchmark harder

Add underlines into the mix with the Emoji heavy
text, to see if we can optimize lines.

4 years agoMerge branch 'half-float' into 'master'
Matthias Clasen [Fri, 9 Apr 2021 03:34:05 +0000 (03:34 +0000)]
Merge branch 'half-float' into 'master'

ngl: Use fp16 for colors

See merge request GNOME/gtk!3405

4 years agoMerge branch 'font-fallback-fix' into 'master'
Matthias Clasen [Thu, 8 Apr 2021 11:24:09 +0000 (11:24 +0000)]
Merge branch 'font-fallback-fix' into 'master'

wayland: Improve font setting fallback more

Closes #3838

See merge request GNOME/gtk!3412

4 years agoWork around compiler shortcomings on macOS
Matthias Clasen [Thu, 8 Apr 2021 02:38:47 +0000 (22:38 -0400)]
Work around compiler shortcomings on macOS

alias attributes don't work on Darwin, so
do without.

4 years agogsk: Add runtime checks for F16C
Matthias Clasen [Thu, 8 Apr 2021 01:29:21 +0000 (21:29 -0400)]
gsk: Add runtime checks for F16C

Use an IFUNC resolver to determine whether we can use
intrinsics for FP16 conversion. This requires the functions
to be no longer inline.

Sadly, it turns out that __builtin_cpu_supports ("f16c")
doesn't compile on the systems where we want it to prevent
us from getting a SIGILL at runtime.

4 years agoAdd an option to disable F16C
Matthias Clasen [Wed, 7 Apr 2021 23:41:54 +0000 (19:41 -0400)]
Add an option to disable F16C

And add a compile time check for the presence of this
CPU feature.

4 years agoMove color conversion up
Matthias Clasen [Wed, 7 Apr 2021 03:52:33 +0000 (23:52 -0400)]
Move color conversion up

Doing the color conversion early lets us reuse
the results whenever we do more than one draw
per node.

4 years agongl: Use a constant for (fp16)-1
Matthias Clasen [Wed, 7 Apr 2021 03:11:27 +0000 (23:11 -0400)]
ngl: Use a constant for (fp16)-1

No need to convert that again for every glyph.

4 years agongl: Reduce vertex storage
Matthias Clasen [Wed, 7 Apr 2021 02:24:37 +0000 (22:24 -0400)]
ngl: Reduce vertex storage

We only have one shader that uses the color2 attribute,
and it doesn't use the uv attribute, so save vertex
memory by putting those in the same space.

This reduce the per vertex space from 32 to 24 bytes.

4 years agongl: Use fp16 for colors
Matthias Clasen [Wed, 7 Apr 2021 01:55:50 +0000 (21:55 -0400)]
ngl: Use fp16 for colors

This reduces the size of our Vertex struct from
48 to 32 bytes. It would be nicer if we could store
the colors in fp16 format in the rendernodes, and
avoid conversion here. But this is still good.

4 years agowayland: Improve font setting fallback more
Matthias Clasen [Wed, 7 Apr 2021 18:53:00 +0000 (14:53 -0400)]
wayland: Improve font setting fallback more

We may get a response from the portal that contains
no useful settings at all. In that case, we should
fallback as well.

Fixes: #3838
4 years agoMerge branch 'wip/carlosg/stuck-frames' into 'master'
Matthias Clasen [Wed, 7 Apr 2021 23:18:25 +0000 (23:18 +0000)]
Merge branch 'wip/carlosg/stuck-frames' into 'master'

surface: Always set PHASE_PAINT as pending when updates are scheduled

Closes #3750

See merge request GNOME/gtk!3411

4 years agosurface: Always set PHASE_PAINT as pending when updates are scheduled
Carlos Garnacho [Wed, 7 Apr 2021 19:04:28 +0000 (21:04 +0200)]
surface: Always set PHASE_PAINT as pending when updates are scheduled

At times (most often when closing subsurfaces that are scheduling
relayouts) the PHASE_PAINT handling gets broken with the following
sequence:

1. Surface receives wl_callback.done for the previous frame.
   Surface is thawed.
2. A new update on the surface is scheduled. PHASE_PAINT is
   requested directly on the frame clock. priv->pending_phase is
   left unset in the surface.
3. Surface gets frozen
4. Frame clock processes the update scheduled at 2. The surface
   is frozen, so paint is prevented. PHASE_PAINT is considered
   handled.
5. Compositor emits wl_callback.done again. Surface is thawed.
6. At this point the machinery is off
   - The surface didn't paint but has pending update regions
   - priv->draw_needed is set in the toplevel and other portions
     of the widget tree
   - So queueing redraws is ineffective at eventually calling
     gdk_surface_schedule_update() again on the toplevel surface.
   - We don't paint anymore, so this broken state is not flushed
     until other subsurface changes manage to schedule the missing
     update.

To fix this, always set PHASE_PAINT in priv->pending_phase when
doing gdk_surface_schedule_update(). If the frame clock turns
around before the surface is thawed, it will still be waiting to
be processed the next iteration.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3750
4 years agoMerge branch 'font-settings-fallback-4' into 'master'
Matthias Clasen [Wed, 7 Apr 2021 13:21:38 +0000 (13:21 +0000)]
Merge branch 'font-settings-fallback-4' into 'master'

wayland: Improve font setting fallback

See merge request GNOME/gtk!3407

5 years agowayland: Improve font setting fallback
Matthias Clasen [Wed, 7 Apr 2021 12:49:54 +0000 (08:49 -0400)]
wayland: Improve font setting fallback

When we don't get stettings from the portal, the current
fallback is 'awful fonts'. There is no need for that. Instead,
set the fallback values to grayscale antialiasing with slight
hinting.